﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using flsfragusseModel;

public partial class partnerConfirmPartnerChanges : System.Web.UI.Page
{
    


      



    protected void Page_Load(object sender, EventArgs e)
    {


        if (!IsPostBack)
        {
            lblreferer.Text = Request.UrlReferrer.PathAndQuery.ToString();
        }

        if (Session["fragusLeasingUserID"] != null && Session["fragusLeasingUserTypeID"] != null)
        {
            //   string test = Session["flspartnerwebtype"].ToString();
        }
        else
        {
            Response.Redirect("..\\default.aspx?error=1");
        }
       


        ucEditPost1.mode = 2;
        ucEditPost1.Start();



        ucEditPost1.SetDatagridview(grdList);

        // ska vi lista alla ändringar fråm salesmen 
        if(ucEditPost1.mode==Convert.ToInt32(modeUser.ADMINISTRATOR))
        {

          // if (!IsPostBack)
              ucEditPost1.FillGrid();
            //1 salesmen


         
           
        }

      


      
       
    }
  
    protected void grdList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Select")
        {
               int index = Convert.ToInt32(e.CommandArgument);
                int vehicleid = Convert.ToInt32(grdList.DataKeys[index].Value);
                ucEditPost1.LoadChangesAndCompare(vehicleid);
            
        } 


    }
    protected void grdList_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void btn1_Click(object sender, EventArgs e)
    {
        Response.Redirect(lblreferer.Text);
    }
}